{template 'common/header-storex'}
<div class="wn-main">
	<div class="wn-main__head">
		{if !empty($_GPC['title'])}
		<a href="{php echo $this->createWebUrl('shop_comment',array('storeid'=>$storeid))}">商品评价</a> / {$_GPC['title']}
		{else}
			商品评价
		{/if}
	</div>
	<div id="goods-modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
		<div class="modal-dialog modal-dialog-default modal-lg">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
					<h3>
						<ul role="tablist" class="nav nav-pills" style="font-size:14px; margin-top:-20px;">
							<li role="presentation" class="basic">
								<a data-toggle="tab" data-type="basic" role="tab" aria-controls="baisc" href="#basic">选择需要评价的商品</a>
							</li>
						</ul>
					</h3>
				</div>
				<div class="modal-body modules-content">
					<div class="tab-content">
						<ul class="app-allow-list">
							{loop $goods_list $goods}
							<li class="js-select-goods" data-id="{$goods['id']}">
								<div class="app-info">
									<img src="{php echo tomedia($goods['thumb'])}"/>
									<p>{$goods['title']}</p>
								</div>
								<a href="javascript:;" class="cover-dark">
									<i class="fa fa-check cover-selected"></i>
								</a>
							</li>
							{/loop}
						</ul>
					</div>
				</div>
				<div class="modal-footer">
				</div>
			</div>
		</div>
	</div>
	<div class="wn-main__content">
		<form class="form-horizontal form" method="post" enctype="multipart/form-data">
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 control-label">选择商品</label>
				<div class="col-sm-3 col-xs-12">
					<input type="text" readonly class="form-control" name="goods_title" value="{$goods_list[$comment_info['goodsid']]['title']}">
					<input type="hidden" class="form-control" name="goodsid" value="{$comment_info['goodsid']}">
				</div>
				{if empty($_GPC['id'])}
				<div class="col-sm-3 col-xs-12">
					<a href="javascript:;" class="btn btn-primary we7-padding-horizontal js-add-goods">添加商品</a>
				</div>
				{/if}
			</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 control-label">缩略图</label>
				<div class="col-sm-9 col-xs-12">
					{php echo tpl_form_field_image('thumb',$comment_info['thumb'])}
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 control-label">用户昵称</label>
				<div class="col-sm-9 col-xs-12">
					<input type="text" name="nickname" class="form-control" value="{$comment_info['nickname']}">
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 control-label">评分等级</label>
				<div class="col-sm-9 col-xs-12">
					<input type="text" name="comment_level" class="form-control" value="{$comment_info['comment_level']}">
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 control-label">评价内容</label>
				<div class="col-sm-9 col-xs-12">
					<input type="text" name="comment" class="form-control" value="{$comment_info['comment']}">
				</div>
			</div>
			<div class="form-group col-sm-12">
				<input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" />
				<input type="hidden" name="token" value="{$_W['token']}" />
			</div>
		</form>
	</div>
</div>
<script type="text/javascript">
	var goods_list = {php echo json_encode($goods_list);};
	$('.js-add-goods').click(function() {
		$('#goods-modal').modal('show');
	});
	$('.js-select-goods').click(function() {
		id = $(this).data('id');
		$('input[name="goods_title"]').val(goods_list[id].title);
		$('input[name="goodsid"]').val(id);
		$('#goods-modal').modal('hide');
	});
	
</script>
{template 'common/footer-storex'}